//首页的效果
function indexData(){
	var contentList = document.getElementsByClassName('content-list')[0]
	var indexdata = {
		"data":[{
			"title":"抖音是什么",
			"des":"从产品与模式的角度认识抖音",
			"id":0,
			"icon":""
		},
		{
			"title":"抖音案例",
			"des":"盘点抖音精彩热门案例",
			"id":1
		},
		{
			"title":"抖音方法论",
			"des":"如何系统的学习去运营抖音",
			"id":2
		},
		{
			"title":"抖音教程",
			"des":"从基本功能与案例教程教你玩抖音",
			"id":3
		},
		{
			"title":"抖音小工具",
			"des":"抖音玩法过程中的小工具推荐",
			"id":4
		},
		{
			"title":"抖音黑板报",
			"des":"抖音新闻趣闻汇总",
			"id":5
		}]
	}
	indexdata.data.forEach(function(item,index){
		contentList.innerHTML+=muban(item);
	})
}
//首页模板
function muban(item){
	return '<div class="list-item">'+
				'<a href="classify.html?id='+item.id+'">'+
					'<div class="item-icon">'+
						'<img src="img/index/icon'+(item.id+1)+'.png" alt="">'+
					'</div>'+
					'<div class="item-word">'+
						'<h4>'+item.title+'</h4>'+
						'<p>'+item.des+'</p>'+
					'</div>'+
				'</a>'+	
			'</div>'
}
//分类处理参数
function getData(){
	var res = location.search.slice(1);
	res = res.split("=");
	var obj ={}
	obj[res[0]] = Number.parseInt(res[1]);
	console.log(obj);
}

//
function getNavData(a){
	var li = document.getElementsByClassName("nav")[0].children;
	for(var i=0;i<li.length;i++){
		li[i].classList.remove("act");
	}
	li[a].classList.add("act");
}
